<?php

class XzctController extends Controller {
    public function index(){
    	$this->assign('title',"新增词条");
        $m=M('Bzgl');
        $list = $m->field(true)->order('pid,sort')->select();
        $this->assign('list', $list); 
		$this->display();
    }
    public function ctadd(){
        $m=M('Ctgl');
        $date=date('Y-m-d H:i:s');
        $ctgl['addtime']=$date;
        $ctgl['bzname']=$_POST['bzname'];
        $ctgl['label']=$_POST['label'];
        $ctgl['name']=$_POST['name'];
        $ctgl['content']=$_POST['content'];
        $ctgl['title']=$_POST['title'];
        $m->data($ctgl)->add();

    }
}